package com.javasea.logback.controller;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.logging.LogManager;

/**
 * @ClassName DemoController
 * @Description TODO
 * @Author longxiaonan@163.com
 * @Date 2019/7/11 0011 13:07
 */
@RestController
public class DemoController {

    private static final Logger log = LoggerFactory.getLogger(DemoController.class);


    /**
     * 发现使用chrome浏览器发送多个请求到springboot服务的时候，springboot服务器挨个处理请求。
     * 因为chrome浏览器对相同请求做了排队处理。而不是springboot对消息处理进行了同步
     */
    @GetMapping("/test")
    public void test(){
        log.error(">>>>>>>>>>>>>>");
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.error("error test");
        log.info("info test");
        log.debug("debug test");
        log.error("<<<<<<<<<<<<<<<<<");
    }
}
